@import '~styles/vars';
@import '~styles/extendables';
@import '~styles/mixins';

.input {
  position: relative;
  width: 100%;
  transition: width 300ms ease-in-out;

  &.animate {
    width: 80%;

    &.full {
      width: 100%;
    }
  }

  &.dark {
    .icon {
      filter: none;
    }

    input[type='text'] {
      background: rgba($color-black, 0.1);
      border: 0;

      &::placeholder {
        color: $color-grey-shade-3;
      }
    }
  }

  $radius: 50px;

  .disabled-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    border-radius: $radius;
  }

  input[type='text'] {
    width: 100%;
    background: rgba($color-grey-shade-1, 0.3);
    border: 1px solid rgba($color-grey-shade-2, 0.3);
    border-radius: $radius;
    padding: 10.5px 5px;
    text-indent: 10px;
    font-weight: $font-semi-bold;
    line-height: normal;
    outline: 0;
    -webkit-appearance: none;
    appearance: none;

    &.has-left-icon {
      text-indent: 25px;
    }

    &:disabled {
      opacity: 1;
    }

    &::placeholder {
      font-size: 15px;
      color: $color-grey-shade-5;
    }
  }

  .icon {
    @include icon-shadow($color-grey-shade-2, 1px);
    position: absolute;
    top: 50%;
    margin-top: -8px;
    font-size: 15px;
  }

  .left-icon {
    left: 10px;
  }

  .right-icon {
    right: 10px;
  }
}
